#include<iostream>
#include"RBTree.h"
#include<vector>
using std::vector;

int main()
{
   // xzj::RBTree<int> rbt;
   // 
   // int arr[]={1,2,3,4,5,6,7,7,8,9,0};
   // //int arr[] = {16,3,7,11,9,28,18,14,15};
   // //int arr[] = {4,2,6,1,3,5,15,7,16,14};

   // for(int e:arr)
   // {
   //     rbt.insert(e);
   // }

   // std::cout<<rbt.isRBTreeBalance()<<std::endl;
   // rbt.preOrder();

    int N = 10000000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));
	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand() + i);
        //v.push_back(i);
	}
	size_t begin2 = clock();
	xzj::RBTree<int> rbt;
	for (auto e : v)
	{
		rbt.insert(e);
	}

	size_t end2 = clock();
    std::cout << "Insert:" << end2 - begin2 << std::endl;
    std::cout << rbt.isRBTreeBalance() << std::endl;

    return 0;
}
